break;
case GDK_OWNER_CHANGE:
- new_event->owner_change.owner = g_object_ref (event->owner_change.owner);
+ new_event->owner_change.owner = event->owner_change.owner;
+ if (new_event->owner_change.owner)
+ g_object_ref (new_event->owner_change.owner);
break;
default:
break;
case GDK_OWNER_CHANGE:
- g_object_unref (event->owner_change.owner);
+ if (event->owner_change.owner)
+ g_object_unref (event->owner_change.owner);
break;
default:
/**
* GdkEventOwnerChange:
* @type: the type of the event (%GDK_OWNER_CHANGE).
- * @window: the window which received the event.
+ * @window: the window which received the event
* @send_event: %TRUE if the event was sent explicitly (e.g. using
- * <function>XSendEvent</function>).
- * @owner: the new owner of the selection.
- * @reason: the reason for the ownership change as a #GdkOwnerChange value.
- * @selection: the atom identifying the selection.
- * @time: the timestamp of the event.
+ * <function>XSendEvent</function>)
+ * @owner: the new owner of the selection, or %NULL if there is none
+ * @reason: the reason for the ownership change as a #GdkOwnerChange value
+ * @selection: the atom identifying the selection
+ * @time: the timestamp of the event
* @selection_time: the time at which the selection ownership was taken
- * over.
+ * over
*
* Generated when the owner of a selection changes. On X11, this
* information is only available if the X server supports the XFIXES
event->owner_change.type = GDK_OWNER_CHANGE;
event->owner_change.window = window;
- event->owner_change.owner = gdk_x11_window_foreign_new_for_display (display,
- selection_notify->owner);
+ if (selection_notify->owner != None)
+ event->owner_change.owner = gdk_x11_window_foreign_new_for_display (display,
+ selection_notify->owner);
+ else
+ event->owner_change.owner = NULL;
event->owner_change.reason = selection_notify->subtype;
event->owner_change.selection =
gdk_x11_xatom_to_atom_for_display (display,